//
//  ViewController.m
//  MPOtherHomeDemo
//
//  Created by YC on 2018/9/5.
//  Copyright © 2018年 yc. All rights reserved.
//

#import "ViewController.h"
#import "MPOtherHomeVC.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    NSString *dateStr1 = @"2018-09-06 19:37:04";
    NSString *dateStr2 = @"2018-09-01 19:37:04";
    NSString *dateStr3 = @"2018-09-02 19:37:04";


    
    NSDateFormatter *format = [[NSDateFormatter alloc] init];
    [format setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
    NSDate *date1 = [format dateFromString:dateStr1];
    
    BOOL result1 = [[NSCalendar currentCalendar] isDateInToday:date1];
    BOOL result2 = [[NSCalendar currentCalendar] isDateInYesterday:date1];
    BOOL result3 = [[NSCalendar currentCalendar] isDateInTomorrow:date1];
    BOOL result4 = [[NSCalendar currentCalendar] isDateInWeekend:date1];
    NSLog(@"%d %d %d %d",result1,result2,result3,result4);
    
    NSDate *date2 = [format dateFromString:dateStr2];
    NSDate *date3 = [format dateFromString:dateStr3];

    BOOL result5 = [[NSCalendar currentCalendar] isDateInWeekend:date2];
    BOOL result6 = [[NSCalendar currentCalendar] isDateInWeekend:date3];
    NSLog(@"%d %d",result5,result6);

}

- (IBAction)pushClick:(id)sender {
    MPOtherHomeVC *vc = [MPOtherHomeVC new];
    [self.navigationController pushViewController:vc animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
